package com.winteam.View;

import org.junit.Test;

import javax.swing.*;
import java.awt.*;

public class WelcomeScreen extends JFrame {
    public WelcomeScreen() {
        super.setTitle("系统登录");

        this.setResizable(false);//让窗口大小不可改变
        this.setLayout(null);
        this.setUndecorated(true);//隐藏边框和控件
    this.pack();//自适应大小
        //添加背景图片
        ImageIcon icon=new ImageIcon(this.getClass().getResource("img/Login.gif"));
        JLabel label=new JLabel(icon);//将图片放入label中
        label.setSize(icon.getIconWidth(),icon.getIconHeight());//设置label的大小


    this.setSize(icon.getIconWidth(),icon.getIconHeight());
        this.setLocationRelativeTo(null);//让窗口在屏幕中间显示
        this.add(label);

    this.setVisible(true);//窗口显示
         }

    public static void main(String[] args) {
        new WelcomeScreen();
    }
}
